package com.jiazhong.service.impl;

import com.jiazhong.dao.StudentMapper;
import com.jiazhong.pojo.Student;
import com.jiazhong.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;

    @Override
    public List<Student> selectAllService() {
        List<Student> students = studentMapper.selectAllDao();
        return students;
    }

    @Override
    public Integer insertService(Student student) {
        Integer ins = studentMapper.insertDao(student);
        return ins;
    }

    @Override
    public Integer deleteService(Integer id) {
        Integer del = studentMapper.deleteDao(id);
        return del;
    }

    @Override
    public Student getOneService(Integer id) {
        Student oneDao = studentMapper.getOneDao(id);
        return oneDao;
    }

    @Override
    public Integer updateService(Student student) {
        Integer upd = studentMapper.updateDao(student);
        return upd;
    }
}
